home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / NeXTmj / Source / Help.h < prev    next >
C/C++ Source or Header  |  1991-03-22  |  2KB  |  69 lines

  1.  
  2. /*
  3.  * This class is used to provide help
  4.  *    to the operator.
  5.  *
  6.  * Help is provided by a momentary push button on the window.  When first 
  7.  *    clicked a search index is set to 0.  Tile searches are performed by searching 
  8.  *    from the current search index to the end of the tile list.  If a match isn't
  9.  *    found the index is incremented and the scan starts anew until either a match
  10.  *    is found or all tiles have been exhausted.  When a match is found the two tiles 
  11.  *    are highlighted.
  12.  *
  13.  $Author$
  14.  $Header$
  15.  *
  16.  $Log$
  17.  */
  18.  
  19. #import    "GameTileArray.h"
  20. #import    "TileDescriptionArray.h"
  21. #import    "TileIterator.h"
  22.  
  23.  
  24. class Help {
  25. private:
  26.                                                 // This variable holds the current search
  27.                                                 //    index into the Game Board tile matrix.
  28.                                                 // Scans for tile matches begin at this 
  29.                                                 //    value + 1.
  30.     TileIterator            my_iterator;
  31.                                                 // Used to search through the tiles on
  32.                                                 //    the Game Board looking for tiles
  33.     TileDescriptionArray    tile_descriptions;
  34.                                                 // This method uses the iterator to search
  35.                                                 //    a Game Tile array for a tile that is
  36.                                                 //    selectable. 
  37.                                                 // This method returns a -1 if no tile is 
  38.                                                 //    found.
  39.     int                        findNextSelectableTile( GameTileArray& );
  40.                                                 // This flag indicates wheather help
  41.                                                 //    has any tiles selected on the Game
  42.                                                 //    Board.
  43.     BOOL                    tiles_selected;
  44.  
  45. public:
  46.     
  47.                                                 // This method is indirectly called when the
  48.                                                 //    help button is pressed on the game
  49.                                                 //    window. 
  50.                                                 //    Objective-C to C++ interface routines.
  51.     void    helpClick( GameTileArray& );
  52.                                                 // This method is called every time a 
  53.                                                 //    tile is clicked.  It resets the search
  54.                                                 //    index.  When a tile is clicked we 
  55.                                                 //    assume that help is no longer needed.
  56.     void    resetHelp( void );
  57.                                                 // This method returns the value of 
  58.                                                 //    the tiles_selected variable.
  59.                                                 // This method is used to indicate
  60.                                                 //    wheather Help has any tiles selected
  61.                                                 //    on the Game Board.  It is set in
  62.                                                 //    helpClick() and cleared in resetHelp().
  63.                                                 // This method is intended for another
  64.                                                 //    object to make a descision to unselect
  65.                                                 //    tiles on the Game Board.
  66.     BOOL    isSelected( void );
  67. };
  68.  
  69.